[codex] add admin leaderboard submission listing#477
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1e715e4b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "limit": limit, | ||
| "offset": offset, |
There was a problem hiding this comment.
Return clamped pagination values in response
get_leaderboard_submission_history clamps limit to [1, 1000] and offset to >=0, but this handler echoes the raw query values, so the response metadata can disagree with what the DB actually applied (for example, limit=5000 returns at most 1000 rows while reporting limit: 5000, or offset=-10 reports -10 while querying from 0). This can break admin pagination clients that trust the returned limit/offset to compute the next page.
Useful? React with 👍 / 👎.
What changed
Adds an admin-only API endpoint to list all submissions for a leaderboard with stable metadata needed for manual cleanup and ID-by-ID deletion.
GET /admin/leaderboards/{leaderboard_name}/submissionsLeaderboardDB.get_leaderboard_submission_history(...)Why
The existing admin API could delete submissions by ID or delete all submissions for a user, but it did not expose a supported way to enumerate all submission IDs on a leaderboard first.
Impact
Admins can now:
Validation
./.venv/bin/pytest tests/test_admin_api.py -qNotes
This PR only includes the endpoint, DB helper, and tests. It intentionally excludes unrelated local changes in the worktree.